<?php
/*
	Generates the quiry data for current stock level			
				
	Created by		 : Lee
	Created On		 : 29.August.2011
	Last Modification: created document
	Modified On		 : 29.August.2011
	Modified By		 : Lee			
*/
			
// Include the functions.php
require "include/functions.php";

// Check_session();

// Define Data Variables
$name="";

// Requestings inputs from the form to php variables
if(!filter_has_var(INPUT_POST, "name")){}
else
	{
		$name = $_REQUEST["name"];
	}
?>

<html>
<head>
<title>Home Electronics - Suppliers Listing</title>
<link rel="stylesheet" href="include/styles.css" type="text/css">
<script src="include/functions.js"></script>
<script>window.onload=function(){
	altRows('alternatecolor');
}</script>
</head>
<body>
<div id="container" align="center">

		<div id="body" align="center">
		<div>
		 <h1>Suppliers Listing</h1> 
            <fieldset style="width:94%; text-align:center">
            <legend>Search Criteria</legend>
            <form name="form1" action="suppliers_listing.php" method="post">
            <table style="margin-right:290">
            	<tr>
                    <td>Name</td><td><input name='name' value='<?=$name?>'/></td><td><input type="submit" name="Search"></td>
                </tr>
            </table>
            </form>
            </fieldset>
        	<?php
			
			$table = ('supplier s');
			$table_rows= array ('s.supplier_id','s.name','s.contact_name','s.address','s.phone','s.email');
			$condition = ("(name like '$name%' or name='')");
		
			echo("<table class='altrowstable' id='alternatecolor'><tr><th>ID</th><th>Name</th><th>Contact Name</th><th>Address</th><th>Phone</th><th>Email</th></tr>");
			$result = query_table("home_electronics","","home_e",$table,$table_rows,$condition, false, false);
			echo($result."<table></a>");

		?>
		</div>
	</div> <!--body div -->
   		
</div>
</body>
</html>





